import java.util.*;
public class Main {
    public static boolean isss(int n){
        for(int i=2;i<n;i++){
            if(n%i==0){
                return false;
            }
        }return true;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num=sc.nextInt();
        int half=num/2;
        int m=half,n=half;
        while(m!=0){
            if(isss(m)&&isss(n)){
                System.out.println(m);
                System.out.println(n);
                break;
            }
            m--;
            n++;
        }
    }
}
